{$CLEO .cs}
{$USE cleo+}
0000:
const

1PLAYER1_CAR_HEALTH   = 1@
1PLAYER2_CAR_HEALTH   = 2@   
PLAYER2_CAR = 3@
PLAYER1_CAR = 4@

end

while true 
wait 0 
  0AE2: PLAYER1_CAR = random_vehicle_near_point 0.0 0.0 0.0 in_radius 9999999.0 find_next 1 pass_wrecked 1
  0AE2: PLAYER2_CAR = random_vehicle_near_point 0.0 0.0 0.0  in_radius 9999999.0 find_next 1 pass_wrecked 1

        if is_car_defined  PLAYER1_CAR
        then             
            if and 
            not is_car_owned_by_player PLAYER1_CAR  
            09DE:   actor player1 entering_car
            then
            1PLAYER1_CAR_HEALTH= car.Health(PLAYER1_CAR)
                if  1PLAYER1_CAR_HEALTH < 20000
                then  
                    car.Health(PLAYER1_CAR) = 500000
                    09C4: set_car PLAYER1_CAR gas_tank_explosion_enabled 0
                    set_car_owned_by_player PLAYER1_CAR true
        
                end    
            end
            if  and
            not is_car_owned_by_player PLAYER1_CAR   
            actor.InCar(player1, PLAYER1_CAR)
            then
            1PLAYER1_CAR_HEALTH= car.Health(PLAYER1_CAR)
                if  1PLAYER1_CAR_HEALTH < 20000
                then
                   // set_car_owned_by_player PLAYER1_CAR true 
                    car.Health(PLAYER1_CAR) = 500000
                    set_car_owned_by_player PLAYER1_CAR true
                    09C4: set_car PLAYER1_CAR gas_tank_explosion_enabled 0
                end
            end  
        end
           
        if and
         coop
         is_car_defined  PLAYER2_CAR
        then 
            if  and
            not is_car_owned_by_player PLAYER2_CAR     
            09DE:   actor player2 entering_car
            then
            1PLAYER2_CAR_HEALTH= car.Health(PLAYER2_CAR)
                if  1PLAYER2_CAR_HEALTH < 20000
                then 
                    set_car_owned_by_player PLAYER2_CAR  true 
                    car.Health(PLAYER2_CAR) = 500000
                    09C4: set_car PLAYER2_CAR gas_tank_explosion_enabled 0            
                end    
            end
            if or  
            09DE:   actor player2 entering_car
            actor.InCar(player2, PLAYER2_CAR)
            then
            
            1PLAYER2_CAR_HEALTH= car.Health(PLAYER2_CAR)
                if  1PLAYER2_CAR_HEALTH < 20000
                then
                    set_car_owned_by_player PLAYER2_CAR  true 
                     09C4: set_car PLAYER2_CAR gas_tank_explosion_enabled 0            
                   // set_car_owned_by_player PLAYER1_CAR true 
                    car.Health(PLAYER2_CAR) = 500000
                end
           
           
            end  
        end 

end
0A93: terminate_this_custom_script